using System.Collections.Generic;

public class Table_SceneClassItem : IDataItem
{
	/// <summary>
	/// 唯一ID
	/// <summary>
	public int Id { get; private set; }
	/// <summary>
	/// 名称
	/// <summary>
	public string Name { get; private set; }
	/// <summary>
	/// 场景图片
	/// <summary>
	public string SceneImg { get; private set; }
	/// <summary>
	/// 场景图集
	/// <summary>
	public string SceneAtlas { get; private set; }
	/// <summary>
	/// 场景资源
	/// <summary>
	public string SceneName { get; private set; }
	/// <summary>
	/// 资源名称
	/// <summary>
	public string ResName { get; private set; }
	/// <summary>
	/// 副本类型
	/// <summary>
	public int SceneType { get; private set; }
	/// <summary>
	/// 地表高度最大值
	/// <summary>
	public int TerrainHeightMax { get; private set; }
	/// <summary>
	/// 地表场景大小
	/// <summary>
	public string MapSize { get; private set; }
	/// <summary>
	/// 地表高度图大小
	/// <summary>
	public string TerrainMap { get; private set; }
	/// <summary>
	/// 雷达图片大小
	/// <summary>
	public string SceneMap { get; private set; }
	/// <summary>
	/// 雷达地图资源
	/// <summary>
	public string SceneMapTexture { get; private set; }
	/// <summary>
	/// 入口坐标
	/// <summary>
	public int GetEntry_PosCount() { return Entry_Pos.Count; }
	private List<int> Entry_Pos = new List<int>();
	public int GetEntry_PosByIndex(int idx)
	{
		return Entry_Pos.GetValueByIdx(idx, 0);
	}
	/// <summary>
	/// 安全坐标
	/// <summary>
	public int GetSafe__PosCount() { return Safe__Pos.Count; }
	private List<int> Safe__Pos = new List<int>();
	public int GetSafe__PosByIndex(int idx)
	{
		return Safe__Pos.GetValueByIdx(idx, 0);
	}
	/// <summary>
	/// 背景音乐ID
	/// <summary>
	public int BGMusic { get; private set; }
	/// <summary>
	/// 界面ID
	/// <summary>
	public int GetPanelIdCount() { return PanelId.Count; }
	private List<int> PanelId = new List<int>();
	public int GetPanelIdByIndex(int idx)
	{
		return PanelId.GetValueByIdx(idx, 0);
	}

	public Table_SceneClassItem(ExcelLineReader reader)
	{
		Id = reader.ReadInt();
		Name = reader.ReadString();
		SceneImg = reader.ReadString();
		SceneAtlas = reader.ReadString();
		SceneName = reader.ReadString();
		ResName = reader.ReadString();
		SceneType = reader.ReadInt();
		TerrainHeightMax = reader.ReadInt();
		MapSize = reader.ReadString();
		TerrainMap = reader.ReadString();
		SceneMap = reader.ReadString();
		SceneMapTexture = reader.ReadString();
		Entry_Pos = reader.ReadShortString().ToIntList();
		Safe__Pos = reader.ReadShortString().ToIntList();
		BGMusic = reader.ReadInt();
		PanelId = reader.ReadShortString().ToIntList();
	}
}

public class Table_SceneClassMgr : IDataMgr
{
	protected override string FileName { get { return "Txt/SceneClass.txt"; } }

	protected Dictionary<int, int> mItemDic = new Dictionary<int, int>();
	public int GetIdxById(int key) { return mItemDic[key]; }

	public override void Load(ExcelLineReader reader)
	{
		var item = new Table_SceneClassItem(reader);
		mItemDic[item.Id] = DataCount;
		mItemList.Add(item);
	}

	public Table_SceneClassItem GetItemByIdx(int idx)
	{
		return GetItemByIdx<Table_SceneClassItem>(idx);
	}

	public Table_SceneClassItem GetItemById(int id)
	{
		int idx = GetIdxById(id);
		return GetItemByIdx(idx);
	}
}